Repository navigation
Cut peer-supplied face-room text on code points, not UTF-16 units - #2601
Merged
Merged
Conversation
A cap that landed between the halves of a surrogate pair stored a lone high surrogate for a peer's face-room name, role label, platform line, and the two 200-unit failure details, so a remote member could make a label render as a replacement character. All five cuts now share one code-point bound. Fixes #2438 Docs-not-needed: a cut helper inside an existing sanitiser; no subsystem behaviour changes
Collaborator
Author
|
Verdict: PASS at 35e2819 Ran at this tip: Not run: npm run verify — the host exhausted threads on an earlier attempt; bounded runs above instead. Review notes:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Written-by: Dev
Fixes #2438
Owner: Dev
Reviewer: Reviewer
What changed
A peer's face-room name, role label, platform line and the two 200-unit failure details were capped with a bare
String#slice, so a cap that landed between the halves of a surrogate pair stored a lone high surrogate, which every encoder draws as a replacement character. All five cuts now go through one code-point bound, so the cut lands after a whole character and the 60/80/200 caps count code points instead of UTF-16 units. A remote member can no longer make a label render as�; nothing else changes — same caps in characters, same wording, same wire shape.plugins/social/test/face-text-bounds.test.jsfails 8/8 on the unchanged source and passes 8/8 with the change.Verification at the tip
Tip SHA: 35e2819
Ran:
cd plugins/social && node --test test/face-text-bounds.test.js— red before the source change (8 fail / 0 pass), green after (8 pass)cd plugins/social && node --test test/face-rooms.test.js— 38 passcd plugins/social && node --import ./test/resolve.mjs --test test/social.test.js— 458 pass (itsds-botimport needs the plugin's own resolve hook; without it the file cannot load)node scripts/lint-plugins.mjs— 0 errorsnode .github/scripts/changelog.mjs checkandnode .github/scripts/check-mojibake.mjs --check— cleanNot run (and why): the full
npm run verify— this host exhausts threads when two run at once, so the brief bounded verification to the new test file and the social suite; no other plugin or core file is touched (/compare/653cc056...35e2819reports exactly the three files below).Docs-not-needed: a cut helper inside an existing sanitiser; no subsystem behaviour changes
Checkpoint
{ "pr": 2601, "claim": "Dev", "issue": 2438, "summary": "Peer-supplied face-room names, role labels, platform lines and two failure details were cut with a bare String#slice, so a cut between the halves of a surrogate pair stored a lone surrogate that renders as a replacement character. All five bounds now use one code-point cut, so the cut lands after a whole character and the caps count code points. A 59a+emoji name, a 79a+emoji role and a 199a+emoji platform line are now well formed and keep the whole emoji. No other behaviour changes.", "files": ["plugins/social/src/face-rooms.js", "plugins/social/test/face-text-bounds.test.js", "changelog.d/2438.fixed.md"], "checks": { "ran": "cd plugins/social && node --test test/face-text-bounds.test.js && node --test test/face-rooms.test.js && node --import ./test/resolve.mjs --test test/social.test.js", "result": "green", "at": "35e281950ea33c3f05304d63fe0c63e0ec8af3eb" }, "next": "none — ready for review" }